#ifndef _jpeg_parser_api_h_
#define _jpeg_parser_api_h_

#include "dc_type.h"
#include "dc_jpeg_api.h"
// The ORIENTATION_TYPE values correspond to EXIF 2.2 Orientation tag values
typedef enum ORIENTATION_TYPE
{
  /** No orientation information */
  ORIENTATION_NONE = 0,
  /** default orientation */
  ORIENTATION_NORMAL,
  /** Image mirrored across vertical axis */
  ORIENTATION_MIRRORED,
  /** Image rotated 180 degrees */
  ORIENTATION_ROT180,
  /** Image rotated 180 degrees and mirrored across vertical axis */
  ORIENTATION_ROT180_MIRRORED,
  /** Image rotated 270 degrees clockwise and mirrored across horizontal axis */
  ORIENTATION_ROT270_MIRRORED,
  /** Image rotated 270 degrees clockwise */
  ORIENTATION_ROT270,
  /** Image rotated 90 degrees clockwise and mirrored across horizontal axis */
  ORIENTATION_ROT90_MIRRORED,
  /** Image rotated 90 degrees clockwise */
  ORIENTATION_ROT90
} ORIENTATION_TYPE;

typedef enum SOF_TYPE
{
    SOF_TYPE_0 = 0,
    SOF_TYPE_1,
    SOF_TYPE_2,
    SOF_TYPE_3,
    SOF_TYPE_5 = 5,
    SOF_TYPE_6,
    SOF_TYPE_7,
    SOF_TYPE_9 = 9,
    SOF_TYPE_10,
    SOF_TYPE_11,
    SOF_TYPE_13 = 13,
    SOF_TYPE_14,
    SOF_TYPE_15,
    SOF_TYPE_UNKNOWN,
} SOF_TYPE;

typedef struct JPEG_PARSER_IMAGE_DATA
{
    UINT32                    imageWidth;
    UINT32                    imageHeight;
    int                       imageComponentCount;
    SOF_TYPE                  imageSOFType;
    ORIENTATION_TYPE          imageOrientationType;
    DC_JPEGPIPE_SAMPLE_MODE_t imageComponentSamplingRatioType;
}JPEG_PARSER_IMAGE_DATA;

typedef struct JPEG_PARSER_THUMBNAIL_DATA
{
    boolean                exifThumbnailExists;
    UINT32                 thumbnailLength;
    UINT32                 thumbnailOffset;
    JPEG_PARSER_IMAGE_DATA thumbnailImageData;
}JPEG_PARSER_THUMBNAIL_DATA;

//parent struct with sub types.
typedef struct JPEG_PARSER_DATA
{
    JPEG_PARSER_IMAGE_DATA *imageDataPtr;
    JPEG_PARSER_THUMBNAIL_DATA *thumbnailDataPtr;
}JPEG_PARSER_DATA;

int parseJpegFile(char *inputJpegFile, char *outputThumbnailFile, struct JPEG_PARSER_DATA *jpegParserDataPtr);

#endif
